The package provides the PBMC 3K dataset for interactive exploration with TreeViz. To generate Treeviz objects on your datasets, follow the ExploreTreeViz vignette.
library(palmtree)
library(scran)
data(PBMC3k_TreeViz)
This section follows similar steps as detailed in Seurat’s tutorial - https://satijalab.org/seurat/v3.1/pbmc3k_tutorial.html
library(Seurat)
pbmc.data <- Read10X(data.dir = "../../filtered_gene_bc_matrices/hg19/")
pbmc <- CreateSeuratObject(counts = pbmc.data, project = "pbmc3k", min.cells = 3, min.features = 200)
pbmc[["percent.mt"]] <- PercentageFeatureSet(pbmc, pattern = "^MT-")
pbmc <- NormalizeData(pbmc)
all.genes <- rownames(pbmc)
pbmc <- ScaleData(pbmc, features = all.genes)
pbmc <- FindVariableFeatures(pbmc)
pbmc <- RunPCA(pbmc)
pbmc <- FindNeighbors(pbmc, dims=1:10)
pbmc <- FindClusters(pbmc, resolution=c(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0), save.SNN=TRUE)
pbmc <- RunTSNE(pbmc)
pbmc <- RunUMAP(pbmc, dims=1:5)
PBMC3k_TreeViz <- createFromSeurat(pbmc, reduced_dim = c("pca", "tsne", "umap"), check_metadata = TRUE)
To start interactive exploration on this data,
# to visualize top 100 variable genes
app <- startTreeviz(PBMC3k_TreeViz, top_genes = 100, host="http://localhost:8877")
# to visualize a genes list
# app <- startTreeviz(PBMC3k_TreeViz, genes=c("GBA", "FDPS", "TREM2"))
The app by default chooses resolution 0.4 as a starting set of clusters for exploration. This
facetZoom visualization to navigate the cluster hierarchyn (default to 100) most variable genes from the dataset where counts are aggregated to the choosen cluster resolutionsOverview of Palmtree App
As you are exploring this dataset, you notice in the tsne/umap/pca plots that the clusters (colored orange, green, red and purple) are not well separated.
These clusters (4C1, 4C4, 4C6, 4C7) at cluster resolution 0.4 do not seem to be well separated. So may be I would like to choose a lower resolution for these cells. As I look at the hierarchy in the
facetZoom they belong to the same parent (2C1) at cluster resolution 0.2. I can now choose to cluster these cells at a different resolution (as shown below). This immediately reflects the changes in the dimensionality plots, computes a new count matrix based on the selection and updates the heatmap.